package com.rp.data.tcp_ws.server_tcp;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

public class ServerIniterHandlerTcp extends ChannelInitializer<SocketChannel> {
	@Override
	protected void initChannel(SocketChannel socketChannel) {
		// 管道注册handler
		ChannelPipeline pipeline = socketChannel.pipeline();
		// 编码通道处理
		pipeline.addLast("decode", new MyDecoder());//
		// 转码通道处理
		pipeline.addLast("encode", new MyEncoder());//ISO_8859_1
		// 聊天服务通道处理
		pipeline.addLast("chat", new ServerHandlerTcp());

		//pipeline.addLast(new WebSocketServerProtocolHandler("/ws"));

	}
}
